#include <glib.h>

static void my_log_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
{
    g_print("[%s]my_log_handler : %s \n",user_data,message);

}

gint main(gint argc, gchar **argv)
{
    g_log_set_default_handler(my_log_handler, "User_Data");

    g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);

    g_log ("foo", G_LOG_LEVEL_DEBUG, "6");
    g_log ("bar", G_LOG_LEVEL_DEBUG, "6");
    g_log ("baz", G_LOG_LEVEL_DEBUG, "6");

    return 0;
}
